
export default {
  namespaced: true,
  state: {
    userInfo: [], // 用户信息
    categoryList: [], // 三级分类
    enterprise: [], // 企业
    gongZonHao: [], // 公众号
    minApp: [], // 小程序
    notes: [], // 短信
    phone: [], // 手机号
    accounts: [], // 账号
    currentIndex: 1, // pageHeader tabs
    changeItem: 1, // sidebar item
    tab: 1
  },
  mutations: {
    CATEGORYDATA(state: { categoryList: any; enterprise: any; [propName: string]: any }, data: { children: any }[]) {
      state.categoryList = data
      state.enterprise = data[0].children
      state.gongZonHao = data[1].children
      state.minApp = data[2].children
      state.notes = data[3].children
      state.phone = data[4].children
      state.accounts = data[5].children
    },
    CHANGETAB(state: any, index: number): void {
      state.tab = index
      state.currentIndex = index
    },
    USERINFO(state: { userInfo: any }, data: any) {
      state.userInfo = data
    }
  },
  actions: {
    categoryData(context: { commit: (arg0: string, arg1: any) => void }, data: any) {
      context.commit('CATEGORYDATA', data)
    },
    userInfo(context: { commit: (arg0: string, arg1: any) => void }, data: any) {
      context.commit('USERINFO', data)
    },
    checkedSideItem(context: { commit: arg0 }) {}
  }
}
